class DataUtils::Geo::City < DataUtils::DBObject
    attr_reader :name, :region_id, :country_id, :region, :country
    def initialize(params)
        super(params)
        @name = params[:name]
        @region_id = params[:region_id]
        @country_id = params[:country_id]
    end
    
    def region()
    	return nil if(@region_id.nil?)
    	@region ||= DataUtils::Geo::Region.find_first(:id => @region_id)
    	return @region
    end
    
    def country()
    	c_id = @region_id ? region.country_id : @country_id
    	@country ||= DataUtils::Geo::Country.find_first(:id => c_id)
    	return @country
    end
end
